<?php
class categoryController extends siteController
{
    public function index()
    {
        $cid = intval($_GET['cid']);
        $urlname = in($_GET['urlname']);
        if (empty($cid)&&empty($urlname)) {
            $this->error404();
        }
        if(!empty($cid)){
            $this->info=model('category_info')->info($cid);
        }else if(!empty($urlname)){
            $this->info=model('category_info')->info($urlname,true);
        }else{
            $this->error404();
        }
        
        if (!is_array($this->info)){
            $this->error404();
        }
        if($this->info['model']<>APP_NAME){
            $this->error404();
        }
        $link=$this->display($this->info['url'],true,false);
        echo "<script> window.location.href='".$link."';</script>";
    }

}
